package com.imooc.controller.superadmin;

import com.imooc.entity.bo.ShopCategory;
import com.imooc.entity.dto.Result;
import com.imooc.service.solo.ShopCategoryService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author 折戟沉沙铁未销
 * @version V1.0
 * @date 2020/7/7-2020
 * @Description: 这里用一句话描述这个类的作用
 */
public class ShopCategoryOperationController {

    private ShopCategoryService shopCategoryService;

    /**
     * 增加店铺分类
     * @param request
     * @param response
     * @return
     */
    public Result<Boolean> addShopCategory(HttpServletRequest request, HttpServletResponse response){
        //TODO 参数校验及请求参数转换
        return shopCategoryService.addShopCategory(new ShopCategory());
    }

    /**
     * 删除店铺分类
     * @param request
     * @param response
     * @return
     */
    public Result<Boolean> removeShopCategory(HttpServletRequest request, HttpServletResponse response){
        //TODO 参数校验及请求参数转换
        return shopCategoryService.removeShopCategory(1);
    }

    /**
     * 修改店铺分类
     * @param request
     * @param response
     * @return
     */
    public Result<Boolean> modifyShopCategory(HttpServletRequest request, HttpServletResponse response){
        //TODO 参数校验及请求参数转换
        return shopCategoryService.modifyShopCategory(new ShopCategory());
    }

    /**
     * 根据id查询店铺分类
     * @param request
     * @param response
     * @return
     */
    public Result<ShopCategory> queryShopCategoryById(HttpServletRequest request, HttpServletResponse response){
        //TODO 参数校验及请求参数转换
        return shopCategoryService.queryShopCategoryById(1);
    }

    /**
     * 查询店铺分类
     * @return
     */
    public Result<List<ShopCategory>> queryShopCategory() {
        //TODO 参数校验及请求参数转换
        return shopCategoryService.queryShopCategory(new ShopCategory(), 1, 100);
    }

}
